/*
 *
 *  * Copyright 2019 AsiaInfo-Sec
*
 *
 */

package com.example.exception;

/**
 * 业务异常
 *
 * @author ASAP Framework Team
 * @since 1.0
 */
public class BusinessException extends RuntimeException {
    private static final long serialVersionUID = 5441923856899380112L;

    private int status = 500;

    private String code;

    public BusinessException(String message) {
        this(message, 500);
    }

    public BusinessException(String message, String code) {
        this(message, code, 500);
    }

    public BusinessException(String message, String code, int status) {
        super(message);
        this.code = code;
        this.status = status;
    }

    public BusinessException(String message, int status) {
        super(message);
        this.status = status;
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public BusinessException(String message, Throwable cause, int status) {
        super(message, cause);
        this.status = status;
    }

    public int getStatus() {
        return status;
    }

    public String getCode() {
        return code;
    }
}
